package com.bigshen.demo.project.entity.lifecycle;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class AirPlane {

    public AirPlane() {
        System.out.println("plane 构造方法初始化");
    }

    public void fly() {
        System.out.println("plane is flying");
    }

    @PostConstruct
    public void addOil() {
        System.out.println("plane 起飞前加油！");
    }

    @PreDestroy
    public void close() {
        System.out.println("plane 降落后熄火！");
    }
}
